package largemodel

import (
	"context"
	"github.com/jinzhu/copier"
	model "large-model-platform-backend/mongo"

	"large-model-platform-backend/internal/svc"
	"large-model-platform-backend/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type AddDeepSeekLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewAddDeepSeekLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddDeepSeekLogic {
	return &AddDeepSeekLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *AddDeepSeekLogic) AddDeepSeek(req *types.LargeModelAddDeepSeekReq) (resp *types.BooleanResp, err error) {
	model1 := l.svcCtx.LargeModel
	seek := req.DeepSeek
	deepSeek := model.IDeepSeek{}
	copier.Copy(&deepSeek, &seek)
	err = model1.UpdateDeepSeek(l.ctx, req.ID, deepSeek)
	if err != nil {
		return nil, err
	}

	return &types.BooleanResp{
		Result: types.Result{
			Code: 200,
		},
		Data: true,
	}, nil
}
